//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.datafactory.Team.service;

import com.datafactory.Team.entity.Params;
import com.datafactory.Team.entity.Team;
import com.datafactory.Team.entity.TeamType;
import com.datafactory.Team.mapper.TeamMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class TeamService {
    @Resource
    private TeamMapper teamMapper;

    public TeamService() {
    }

    public PageInfo<Team> findBySearch(Params params) {
        PageHelper.startPage(params.getPageNum(), params.getPageSize());
        List<Team> list = this.teamMapper.findBySearch(params);
        return PageInfo.of(list);
    }

    public PageInfo<TeamType> findBySearchType(Params params) {
        PageHelper.startPage(params.getPageNum(), params.getPageSize());
        List<TeamType> list = this.teamMapper.findBySearchType(params);
        return PageInfo.of(list);
    }

    public void delete(Integer id) {
        this.teamMapper.delete(id);
    }
    public void deleteTeamtype(Integer id) {
        this.teamMapper.deleteTeamtype(id);
    }

    public void add(Team team) {
        this.teamMapper.insertTeam(team);
    }
    public void update(Team team) {
        this.teamMapper.update(team);
    }
    public void updateType(TeamType teamtype) {
        this.teamMapper.updateType(teamtype);
    }
    public void Typeadd(TeamType teamtype) {
        this.teamMapper.insertTeamtype(teamtype);
    }


    public List<Team> findById(Integer id) {
        return this.teamMapper.findById(id);
    }
    public List<TeamType> findByTypeId(Integer id) {
        return this.teamMapper.findByTypeId(id);
    }
}
